package com.my.mvvmrapid.ui.main.fragment.homeshop.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.my.mvvmrapid.ui.main.fragment.homeshop.shopother.HomeShopOtherFragment;
import com.my.mvvmrapid.ui.main.fragment.homeshop.shoptest.HomeShopTestFragment;

@SuppressWarnings("ALL")
public class HomeShopFragmentStateAdapter extends FragmentStateAdapter {

    public HomeShopFragmentStateAdapter(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle) {
        super(fragmentManager, lifecycle);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        if (position == 0) {
            return HomeShopTestFragment.newInstance();
        } else {
            return HomeShopOtherFragment.newInstance();
        }
    }

    @Override
    public int getItemCount() {
        return 7;
    }

}
